<?php
// 本类由系统自动生成，仅供测试用途
namespace Admin\Controller;
use Think\Controller;
class MyinfoController extends Controller {
  public function index(){
    $Myinfo = D('Myinfo');
    $res = $Myinfo->isGetMyinfo();
  }

  public function masa(){
     $this->Islogin();
      $Myinfo = D('Myinfo');
      $res = $Myinfo->getVehicle();
      if(!$res){
        $this->ajaxReturn(['error'=>'1','message'=>'该区域库存车辆缺货！']);die;
      }
      if(isset($res)){
        foreach ($res as $key => $value) {
          if(empty($value['carscolour'])){
            $value['transfer'] = "车辆待调";
            $res[$key] = $value;
          }
        }
      }
      // array_multisort(array_column($arr,'age'),SORT_DESC,$arr);
      $this->ajaxReturn(['success'=>'1','data'=>$res]);
  }

  public function GetInfo() {
    $this->Islogin();
    $myinfo_db = D('Myinfo');
    $field = [
      'usernum','insert_time','id','position','tel','name',
    ];
    $myinfo_data = $myinfo_db->getinfofield(['id'=>session('lampzuo_id')],$field);
    if($myinfo_data){
      echo json_encode(['success'=>'OK','data'=>$myinfo_data]);return;
    }else{
      echo json_encode(['error'=>'1','message'=>'数据获取失败请检查登录状态！']);return;
    }
  }
  
}